import request from '../../util/axios'

// 分页查询利用登记信息
export const getDjList = (data) => request({
  url: '/yuyi-usage-boot/api/use/register/paging',
  method: 'post',
  data: data
})

// 获取登记单号
export const getDengjiDh = () => request({
  url: '/yuyi-usage-boot/api/use/register/registerNo'
})

// 新增利用登记信息
export const addDjList = (data) => request({
  url: '/yuyi-usage-boot/api/use/register',
  method: 'post',
  data: data
})

// 继续办理
export const continueDjList = (id) => request({
  url: `/yuyi-usage-boot/api/use/register/${id}/continuity`,
  method: 'put'
})

// 办结
export const finishDjList = () => request({
  url: '/yuyi-usage-boot/api/use/register/finish',
  method: 'put'
})

// 删除利用登记信息
export const detDjList = (data) => request({
  url: '/yuyi-usage-boot/api/use/register',
  method: 'delete',
  data: data
})

// 登记单预览，返回application/pdf
export const getDjPreviewPdf = (id) => request({
  url: `/yuyi-usage-boot/api/use/register/${id}/stream/pdf`,
  responseType: 'blob'
})
